package com.qf.admin.mapper;

import com.qf.admin.domain.Address;
import com.qf.admin.domain.Orders;
import com.qf.commons.TableData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AddressMapper {

    List<Address> getAddressByUserId(Integer userId);

    void changeTakeDeliveryAddressu(@Param("userId")Integer userId);
    void changeTakeDeliveryAddressa(@Param("addressId")Integer addressId);

    //添加地址
    void addAddress(@Param("userId")Integer userId, @Param("addressName")String addressName, @Param("phone")String phone, @Param("detail")String detail,@Param("state") Integer state);

    //修改地址
    void updateAddress(@Param("userId")Integer userId, @Param("addressName")String addressName,@Param("phone") String phone, @Param("detail")String detail, @Param("state")Integer state, @Param("addressId")Integer addressId);

    //删除地址
    void deleteAddress(@Param("userId")Integer userId, @Param("addressId")Integer addressId);


    //根据aid查询地址
    Address getAddressByAid(@Param("addressId")Integer aid);



    //获取订单管理的信息
    TableData<Orders> getAddress(@Param("limit")Integer limit, @Param("offset")Integer offset);

    //改变订单的默认收货地址
//     void changeTakeDeliveryAddress(Integer userId);

    //获取订单对应用户的信息
    Orders getAddressUser(@Param("id")Integer id);


    //后端查看收货地址的功能
    List<Address> getReceiptAddress(@Param("id") Integer id);


}
